package com.cenwangkeji.resident.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.cenwangkeji.resident.R;
import com.cenwangkeji.resident.model.bean.HealthTypeBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * @松 on 2019/10/24 17:46
 */
public class HomeHealthTypeAdapter extends BaseQuickAdapter<HealthTypeBean.DataBean , BaseViewHolder> {
    public HomeHealthTypeAdapter( @Nullable List<HealthTypeBean.DataBean> data) {
        super(R.layout.item_home_health_type, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HealthTypeBean.DataBean item) {
                    helper.setText(R.id.tv_name, item.getName());
                    ImageView imageView = helper.getView(R.id.iv);
                    if (item.isIs()){
                        imageView.setVisibility(View.VISIBLE);
                    }else {
                        imageView.setVisibility(View.INVISIBLE);
                    }
    }
}
